<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Origami::Trailer</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Origami::Trailer</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/origami/obfuscation_rb.html">
                origami/obfuscation.rb
                </a>
        <br />
                <a href="../../files/origami/trailer_rb.html">
                origami/trailer.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Class representing a <a href="PDF.html">PDF</a> file <a
href="Trailer.html">Trailer</a>.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000605">[]</a>&nbsp;&nbsp;
      <a href="#M000606">[]=</a>&nbsp;&nbsp;
      <a href="#M000607">dictionary=</a>&nbsp;&nbsp;
      <a href="#M000608">has_dictionary?</a>&nbsp;&nbsp;
      <a href="#M000604">new</a>&nbsp;&nbsp;
      <a href="#M000603">to_obfuscated_str</a>&nbsp;&nbsp;
      <a href="#M000609">to_s</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="Configurable.html">Configurable</a></span>
      </div>
    </div>

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">dictionary</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">pdf</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">startxref</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000604" class="method-detail">
        <a name="M000604"></a>

        <div class="method-heading">
          <a href="#M000604" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(startxref = 0, dictionary = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a <a href="Trailer.html#M000604">new</a> <a
href="Trailer.html">Trailer</a>.
</p>
<table>
<tr><td valign="top"><em>startxref</em>:</td><td>The file <em>offset</em> to the <a
href="XRef/Section.html">XRef::Section</a>.

</td></tr>
<tr><td valign="top"><em>dictionary</em>:</td><td>A hash of attributes to set in the <a href="Trailer.html">Trailer</a> <a
href="Dictionary.html">Dictionary</a>.

</td></tr>
</table>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000604-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000604-source">
<pre>
     <span class="ruby-comment cmt"># File origami/trailer.rb, line 112</span>
112:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">startxref</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">dictionary</span> = {})
113:      
114:       <span class="ruby-ivar">@startxref</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dictionary</span> = <span class="ruby-identifier">startxref</span>, <span class="ruby-identifier">dictionary</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Dictionary</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dictionary</span>)
115:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000605" class="method-detail">
        <a name="M000605"></a>

        <div class="method-heading">
          <a href="#M000605" class="method-signature">
          <span class="method-name">[]</span><span class="method-args">(key)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000605-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000605-source">
<pre>
     <span class="ruby-comment cmt"># File origami/trailer.rb, line 134</span>
134:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
135:       <span class="ruby-ivar">@dictionary</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">has_dictionary?</span>
136:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000606" class="method-detail">
        <a name="M000606"></a>

        <div class="method-heading">
          <a href="#M000606" class="method-signature">
          <span class="method-name">[]=</span><span class="method-args">(key,val)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000606-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000606-source">
<pre>
     <span class="ruby-comment cmt"># File origami/trailer.rb, line 138</span>
138:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span>)
139:       <span class="ruby-ivar">@dictionary</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
140:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000607" class="method-detail">
        <a name="M000607"></a>

        <div class="method-heading">
          <a href="#M000607" class="method-signature">
          <span class="method-name">dictionary=</span><span class="method-args">(dict)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000607-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000607-source">
<pre>
     <span class="ruby-comment cmt"># File origami/trailer.rb, line 142</span>
142:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dictionary=</span>(<span class="ruby-identifier">dict</span>)
143:       <span class="ruby-identifier">dict</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dict</span>
144:       <span class="ruby-ivar">@dictionary</span> = <span class="ruby-identifier">dict</span>
145:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000608" class="method-detail">
        <a name="M000608"></a>

        <div class="method-heading">
          <a href="#M000608" class="method-signature">
          <span class="method-name">has_dictionary?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000608-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000608-source">
<pre>
     <span class="ruby-comment cmt"># File origami/trailer.rb, line 147</span>
147:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_dictionary?</span>
148:       <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@dictionary</span>.<span class="ruby-identifier">nil?</span>
149:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000603" class="method-detail">
        <a name="M000603"></a>

        <div class="method-heading">
          <a href="#M000603" class="method-signature">
          <span class="method-name">to_obfuscated_str</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000603-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000603-source">
<pre>
     <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 220</span>
220:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_obfuscated_str</span>
221:       <span class="ruby-identifier">content</span> = <span class="ruby-value str">&quot;&quot;</span>
222:       <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_dictionary?</span>
223:         <span class="ruby-identifier">content</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">TOKENS</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@dictionary</span>.<span class="ruby-identifier">to_obfuscated_str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span>
224:       <span class="ruby-keyword kw">end</span>
225: 
226:       <span class="ruby-identifier">content</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XREF_TOKEN</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@startxref</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">TOKENS</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span>
227: 
228:       <span class="ruby-identifier">content</span>
229:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000609" class="method-detail">
        <a name="M000609"></a>

        <div class="method-heading">
          <a href="#M000609" class="method-signature">
          <span class="method-name">to_s</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Outputs self into <a href="PDF.html">PDF</a> code.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000609-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000609-source">
<pre>
     <span class="ruby-comment cmt"># File origami/trailer.rb, line 154</span>
154:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
155:       
156:       <span class="ruby-identifier">content</span> = <span class="ruby-value str">&quot;&quot;</span>
157:       <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_dictionary?</span>
158:         <span class="ruby-identifier">content</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">TOKENS</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@dictionary</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span>
159:       <span class="ruby-keyword kw">end</span>
160:       
161:       <span class="ruby-identifier">content</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XREF_TOKEN</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@startxref</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">TOKENS</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">EOL</span>
162:                     
163:       <span class="ruby-identifier">content</span>
164:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>